/*
 * CatCakePlatform.cpp
 *
 *  Created on: 2012/9/24
 *      Author: apple
 */


#include <wild/android/CatCakeScene.h>
#include <wild/android/CatCakePlatform.h>
#include <wild/android/LogCat.h>


namespace wild
{
namespace android
{

using namespace wild;
using namespace std;
//--------------------------------------------------------------------------------------

/*
CkWorker::CkWorker(wild::Platform* p)
: ckTask(ORDER_ZERO)
, m_ptr(p)
{
	if(m_ptr)
		return;

	//m_ptr = new CatCakePlatform();
	m_ptr->Initialize();
	m_ptr->Start();


}

CkWorker::~CkWorker()
{
	if(m_ptr)
	{
		m_ptr->Stop();
		m_ptr->Finialize();
	}

	SAFE_DEL( m_ptr );


}
*/
/*
//--------------------------------------------------------------------------------------
void CkStarter::Start(Uint width, Uint height)
{
	ckCreateCatcake("Wild Game", width, height, 60, ckSysMgr::FLAG_VARIABLE_SIZE);

	ckStartCatcake();

	ckNewTask(CkWorker);
}

void CkStarter::Stop()
{
	//ckDeleteTask();

	ckEndCatcake();

	ckDestroyCatcake();
}
*/

//--------------------------------------------------------------------------------------
bool CatCakePlatform::OnConfigure(void)
{
	m_oLogmgr.Regist(new LogCat());

	string str_ = "Eiun's Game Start!!";
	m_oLogmgr.Log(wild::L_DEBUG, str_);



	return true;
}

void CatCakePlatform::OnUpdate()
{

}

void CatCakePlatform::OnStop()
{
	RemoveSceneRoleMgr(m_iScene);
}

void CatCakePlatform::OnStart()
{
	//ScRoleMgrFactory<CatCakeScene> fac_;
	//m_iScene = CreateSceneRoleMgr("Wild Main", &fac_);
	CatCakeScene* poMgr_ = new wild::android::CatCakeScene();
	poMgr_->Start();

	m_iScene = _oSceneList.Add(poMgr_, "Wild Main");
}




}
}


